Repository navigation
feat: record Claude Code's autocompact thrashing stop as an error on the trace (RIUS-1666) - #74
Merged
Merged
Conversation
…the trace (RIUS-1666)
Member
Author
factory/review: pass at cd8341fThe synthetic Verified
Findings (none blocking)
Notes (not findings)
Not verified
|
…comment, document the stop (RIUS-1666)
Member
Author
factory/review: pass at cd48ce7 (round 2, light review)F1 to F3 are fixed. One new P3 test gap is below; it isn't blocking. VerifiedDelta cd8341f..cd48ce7 (fast-forward):
Findings (none blocking)
Not verified
|
Member
Author
factory/review: pass at 0f81037 (round 3, light review)F4 is fixed, and no findings remain open. VerifiedDelta cd48ce7..0f81037 (fast-forward):
FindingsNone. F4 (round 2) is fixed. Not verified
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linear: RIUS-1666 (item 2 of RIUS-1617)
Assumption A44 (no new semconv key). The stop is recorded with names that already exist in rius-semconv v1.10.0:
error.typeand theexceptionevent (exception.type,exception.message). Nothing goes through rius-semconv.What changed
When Claude Code's auto compaction thrashes it stops the turn and writes a synthetic assistant row with
apiError: "autocompact_thrashing". No hook carries it. That row already became an LLM span (model<synthetic>, status OK, no sign of a failure). Now that span is:ERROR,error.type = "autocompact_thrashing";exceptionevent at the row's timestamp,exception.type = "autocompact_thrashing",exception.message= Claude Code's text;Only that exact
apiErrorvalue is matched. Other API-error rows and every transcript without the row are exported as before.Files:
scripts/rius_cc/transcript.py(Entry.api_error()),scripts/rius_cc/spans.py(_generation_span).Verified
pytest -q tests/test_autocompact_thrashing.py: 5 passed (fixture is the real row from session a3b6e6af, 2026-10-08T08:54:16Z, after an ordinary call).spans.pychange reverted, 2 of the 5 fail (the error span and the capture-gate test); restored, they pass.pytest -q(whole suite, py3.13): 2107 passed, 1 skipped.Other open PRs
#70 (release 0.8.0) and #52 (README) touch none of these files. No version bump, no CHANGELOG edit.
Review round 1 (head cd48ce7)
Folded in the reviewer's three P3s: the withheld-text constant is back next to its comment; the stop message is capped (512 bytes, its own constant, since the real message is 257 bytes and the 256-byte tool cap would clip its advice), with a test that fails without the cap; README rows for
error.typeandexception.messagementionautocompact_thrashing. Full suite: 2108 passed, 1 skipped.Challenger waiver (P2, "marker pushes the message past the byte cap"). Not a defect: the cap bounds the kept content and the
…[truncated N bytes]marker adds about 25 bytes (N is a byte count, so it grows by its digit count only, not with the input).truncate()andtool_error_line()cap tool errors the same way (ERROR_MESSAGE_MAX_BYTESplus marker). The test asserts the result stays under 600 bytes for a 2.6 KB input. Note: I pushed the commit in the same command the challenger blocked, before I saw its finding.